package untiring.beans;

import java.util.List;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import untiring.interfaces.MemberDAO;
import untiring.models.MemberVO;

@Repository("memberDAO")
public class MemberDAOImpl implements MemberDAO{
	
	@Autowired
	private SqlSession sqlSession;
	
	@Override
	public boolean insertMember(MemberVO m) {
		boolean result = false;
		if(sqlSession.insert("memberMapper.insertMember",m)>0)
			result = true;
		return result;
	}

	@Override
	public List<MemberVO> selectMember() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public MemberVO selectOneMember(String mno) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean updateMember(MemberVO m) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean deleteMember(String mno) {
		// TODO Auto-generated method stub
		return false;
	}
	
	@Override
	public boolean idcheck(String myuid) {
		boolean result = false;
		System.out.println("aaaaa");
		if((int)sqlSession.selectOne("memberMapper.idcheckSQL",myuid) != 0)
			result = true;
		return result;
	}
	
	@Override
	public MemberVO login(MemberVO m) {
		MemberVO result = sqlSession.selectOne("memberMapper.loginSQL",m);
		
		return result;
	}

}
